Release 10.1A: OpenEdge Getting Started:
Object-oriented Programming


Defining classes

Progress allows you to define a class as a named block that always begins with the CLASS statement and always ends with the END CLASS statement. The CLASS statement identifies the file to the compiler as a class and provides the class type name that other classes can use to inherit from it. This statement can optionally identify a super class that the class inherits from, as well as one or more interface classes that define methods that the class implements. The class can define itself as FINAL, which prevents it from being used as a super class. A class can contain essentially the same kinds of definitions for variables and other data elements as procedures. Classes are always PUBLIC.

The main block of a class can contain non-executable statements that define:

The main block of a class cannot contain any executable statements that are outside of a method, constructor, destructor, or ON statement definition. For more information on defining classes, see the "Defining a class" section.

Comparison with procedure-based programming

A persistent procedure can contain executable statements in its main block and can define parameters. Classes provide a constructor to provide the same functionality. The equivalent of data members for persistent procedures are variables and other data elements defined in the main block. The equivalent of methods for persistent procedures are internal procedures and user-defined functions.


Copyright © 2005 Progress Software Corporation
www.progress.com
Voice: (781) 280-4000
Fax: (781) 280-4095